#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/list.h>

MODULE_LICENSE("GPL");
static char *module_name=0;
module_param(module_name,charp,S_IRUGO);
int __init force_init(void){
	
	struct list_head *modules=(struct list_head *)0xc069b9a0;
	struct module *mod=0;
	struct module *list_mod;
	int i;
	int zero=0;
	if(!module_name)
	{
		printk("force_rmmod need a argument for module name\n");
		return 1;
	}
	list_for_each_entry(list_mod,modules,list){
		if(strcmp(list_mod->name,module_name) == 0)
		  mod=list_mod;
	}
	if(!mod){
		printk("can't find module:%s\n in list modules",module_name);
		return 1;
	}
	printk("mod->state =%d\n",mod->state);
	mod->state=MODULE_STATE_LIVE;
	for (i = 0; i < NR_CPUS; i++){
		printk("before changed,ref[%d].count =%ld\n",i,local_read(&mod->ref[i].count));
	  		mod->ref[i].count=*(local_t *)&zero;
	}
	return 0;
}
void __exit force_exit(void){
}

module_init(force_init);
module_exit(force_exit);

